import Layout from '@/layout'

export default {
  path: '/merchant',
  component: Layout,
  redirect: '/merchant/list',
  name: 'Merchant',
  meta: { title: '商家管理', icon: 'people', noCache: true },
  children: [
    {
      path: 'create',
      component: () => import('@/views/merchant/create'),
      meta: { title: '添加商家', icon: 'edit', noCache: true }
    },
    {
      path: 'edit/:id',
      component: () => import('@/views/merchant/edit'),
      meta: { title: '编辑商家', icon: 'edit', noCache: true },
      hidden: true
    },
    {
      path: 'list',
      name: 'MerchantList',
      component: () => import('@/views/merchant/list'),
      meta: { title: '商家列表', icon: 'list', noCache: true }
    },
    {
      path: 'view/:id',
      component: () => import('@/views/merchant/view'),
      meta: { title: '查看图片', noCache: true },
      hidden: true
    },
    {
      path: 'type',
      name: 'MerchantType',
      component: () => import('@/views/merchant/type'),
      meta: { title: '商家分类', icon: 'list', noCache: true },
      redirect: '/merchant/type/list',
      children: [
        {
          path: 'create',
          component: () => import('@/views/merchant/type/create'),
          meta: { title: '添加分类', icon: 'edit', noCache: true }
        },
        {
          path: 'edit/:id',
          component: () => import('@/views/merchant/type/edit'),
          meta: { title: '编辑分类', icon: 'edit', noCache: true },
          hidden: true
        },
        {
          path: 'list',
          name: 'MerchantTypeList',
          component: () => import('@/views/merchant/type/list'),
          meta: { title: '分类列表', icon: 'list', noCache: true }
        }
      ]
    }
  ]
}
